app=$1
p=$2

if [ "$p" == "" ]; then 
  p="dc"
fi


TZ="Asia/Shanghai"

echo "应用: $app, 参数: $p"

jar_name=$(ls -1 -F *.jar | sort -V | tail -1 ) && \
 java -XX:+UseContainerSupport -XX:MaxRAMPercentage=80  -XX:MaxMetaspaceSize=178m -XX:MetaspaceSize=178m -Xss512k ${JAVA_OPTS} \
 -Dlog4j2.formatMsgNoLookups=true \
 -Dspring.cloud.bootstrap.enabled=true \
 -Dreactor.netty.pool.leasingStrategy=lifo \
 -Dloader.path=lib \
 -jar $jar_name \
 --spring.main.allow-bean-definition-overriding=true \
 --spring.main.allow-circular-references=true \
 --spring.profiles.active=dc-dev,$p \
 --server.port=80 \
 --app.group=public \
 --spring.cloud.nacos.discovery.namespace=public \
 --spring.cloud.nacos.config.namespace=public \
 --spring.application.name=$app 

